<!-- main -->
<link href="<?=$this->data_url?>index_stor.css" rel="stylesheet" type="text/css" media="all" />

<body>

<? if ($cmd == '') {?>
			<table class="datatable" align="center">
				<thead>
					<tr>
						<th><?= $mvc->tr("Name") ?></th>
						<th><?= $mvc->tr("Description") ?></th>
						<th><a class="btn_add" href="<?=$this->base_url?>edit" title="Append storage" style="float:right">A</a></th>
					</tr>
				</thead>

				<?
					$list = $mvc->db->list_tables();

					foreach($list as $key => $row)
					{
						echo '<tr>';
						echo '	<td><a class="plainlink" href="'.$mvc->parse('{base_url}table/view/').$row['name'].'">'.$row['name'].'</a></td>';
						echo '	<td>'.$row['comment'].'</td>'.

							'	<td style="white-space:nowrap">'.
							'		<a onclick="return confirm(\'Storage will be completely removed. Are you sure?\')" '.
							'			href="'.$mvc->parse('{base_url}table/delete').'?name='.$row['name'].'" title="Remove storage" class="btn_del" style="float:right">X</a>'.
							'		<a href="'.$mvc->parse('{base_url}table/edit').'?name='.$row['name'].'" title="Edit storage" class="btn_edit" style="float:right">E</a>'.
							'	</td>'.
							'</tr>';

						echo $html;
					}
				?>
			</table>

<? } ?>
	
<script>
	jQuery('.my_ui_table .btn_add').button({icons:{primary:'ui-icon-circle-plus'}, text:false});
	jQuery('.my_ui_table .btn_edit').button({icons:{primary:'ui-icon-pencil'}, text:false});
	jQuery('.my_ui_table .btn_del').button({icons:{primary:'ui-icon-trash'}, text:false});
	jQuery('.my_ui_table #btn_set').button({icons:{primary:'ui-icon-circle-check'}, text:false}).width('16px').height('16px');
	// Подсветка строки таблицы.
	jQuery('.datatable tbody tr').mouseover( function() {jQuery(this).addClass('hover'); }) ;
	jQuery('.datatable tbody tr').mouseout( function() {jQuery(this).removeClass('hover'); }) ;
</script>

</body>
</html>